package com.jewaton.auth.commons.entity;


import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.*;

import static javax.persistence.GenerationType.IDENTITY;

/**
 * 配置表，缓存起来
 */
@Entity
@Table(name = "CONFIG")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class Config implements java.io.Serializable {

	private long cid;
	private String key;
	private String value;
    private String describe;
	
	public Config() {
	}

	public Config(long cid, String key) {
		this.cid = cid;
		this.key = key;
	}
	
    public Config(String key, String value, String describe) {
        this.key = key;
        this.value = value;
        this.describe = describe;
    }

    @Id
    @GeneratedValue(strategy = IDENTITY)
	@Column(name = "CID", unique = true, nullable = false, precision = 10, scale = 0)
	public long getCid() {
		return this.cid;
	}

	public void setCid(long cid) {
		this.cid = cid;
	}

	@Column(name = "[KEY]", nullable = false)
	public String getKey() {
		return this.key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	@Column(name = "[VALUE]")
	public String getValue() {
		return this.value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	@Column(name = "DESCRIPTION")
    public String getDescribe() {
        return describe;
    }
    public void setDescribe(String describe) {
        this.describe = describe;
    }
	
	

}
